﻿@model KPIS.GERP.Models.ICM.MasPurchaseRegular

@{
    ViewBag.Title = ViewBag.TitleNav = "แก้ไข \"" + Model.Name + "\"";
}

@using (Html.BeginForm("Edit", "MasPurchaseRegular", FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

    <div class="block-button-menu-above">
        @Html.ButtonViewAll()
        @Html.ButtonSubmit()
        @Html.ButtonCancel(new { id = Model.RegularId })
    </div>
    
    @Html.ValidationSummary(true, KPIS.GERP.Models.Class.ValidateText.RequiredField, new { @class = "alert alert-error" })
    @Html.Partial("_EditorForm")
}

@section scripts
{
    <script>
        $("form").submit(function (e) {
            e.preventDefault();
            var currentForm = this;
            bootbox.confirm(function (result) {
                if (result) {
                    currentForm.submit();
                }
            });
        });
    </script>
}